#include "yuvfilespec.h"

YUVFileSpec::YUVFileSpec(int width, int height, int fps, AVPixelFormat format, char *inYuvFilePath,char *outYuvFilePath):
    YUVSpec(width,height,fps,format)
{

    int len = strlen(inYuvFilePath);

    _inYuvFilePath = new char[len+1]{};
    memcpy(_inYuvFilePath,inYuvFilePath,len);

    len = strlen(outYuvFilePath);

    _outYuvFilePath = new char[len+1]{};
    memcpy(_outYuvFilePath,outYuvFilePath,len);
}


YUVFileSpec::YUVFileSpec(const YUVFileSpec &yuvFileSpec):
    YUVFileSpec(yuvFileSpec.getWidth(),
                yuvFileSpec.getHeight(),
                yuvFileSpec.getFps(),
                yuvFileSpec.getFormat(),
                yuvFileSpec._inYuvFilePath,
                yuvFileSpec._outYuvFilePath)
{


}

YUVFileSpec::~YUVFileSpec()
{

    if(_inYuvFilePath) {

        delete [] _inYuvFilePath;
        _inYuvFilePath = nullptr;
    }

    if(_outYuvFilePath) {

        delete [] _outYuvFilePath;
        _outYuvFilePath = nullptr;
    }
}

char *YUVFileSpec::getInYuvFilePath() const
{

    return _inYuvFilePath;
}

char *YUVFileSpec::getOutYuvFilePath() const
{

    return _outYuvFilePath;
}
